GtkThemingEngine: ensure 1px wide frames aren't painted between pixels.
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 8 Nov 2010 19:17:17 +0000 (20:17 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:38:48 +0000 (15:38 +0100)
gtk/gtkthemingengine.c

index a2cd214bec3cad74873d135133bcc06bdb8ecb50..c007274cccc41ebc0d3235dee9157d6ed0a03f10 100644 (file)
@@ -1663,6 +1663,13 @@ gtk_theming_engine_render_frame (GtkThemingEngine *engine,
               width -= border_width;
               height -= border_width;
             }
+          else if (border_width == 1)
+            {
+              x += 0.5;
+              y += 0.5;
+              width -= 1;
+              height -= 1;
+            }
 
           _cairo_round_rectangle_sides (cr, (gdouble) radius, x, y, width, height,
                                         SIDE_ALL, junction);
@@ -1675,13 +1682,16 @@ gtk_theming_engine_render_frame (GtkThemingEngine *engine,
           cairo_set_line_width (cr, border_width);
           cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
 
-          d1 = d2 = 0;
-
           if (border_width > 1)
             {
               d1 = (gdouble) border_width / 2;
               d2 = (gdouble) (border_width - (gint) d1) + 1;
             }
+          else
+            {
+              d1 = 0.5;
+              d2 = 1;
+            }
 
          cairo_save (cr);